
package com.zhisheng.gufei.produce.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.zhisheng.gufei.city.entity.City;

/**
 * Declaration Information
 * 
 * @author xgye
 * @date 2009-9-10
 * @version $Id$
 */
@Entity
@Table(name = "gf_declaration")
public class Declaration {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE,generator="seq")   
    @SequenceGenerator(name="seq", sequenceName="DECLARATION_SEQ")  
    private int id;
    
    /** 申报单位名称  */
    private String name;
    
    private Integer declareYear;
    
    private Integer openningYear;
    
    /** 法人代码 */
    private String cooperationCode;
    
    /** 法人或负责人 */
    private String cooperation;
    
    private String faxNumber;
    
    private String phoneNumber;
    
    /** 行业代码 */
    private Integer tradeCode;
    
    private String zipCode;
    
    private String areaCode;
    
    private String corporationAddress;
    
    /** 环保负责人 */
    private String environmentalPrincipal;
    
    private Date createdTime;
    
    private String createdUser;
    
    /** 审核人 */
    private String assessor;
    
    private Integer needStat;
    
    /** 审核状态 */
    private Integer status;
    
    @OneToOne
    @JoinColumn(name = "cityid")
    private City city;
    
    @OneToMany(cascade = CascadeType.ALL,mappedBy = "declaration",fetch = FetchType.LAZY)
    private Set<Audit> audits;
    
    @OneToOne(cascade = CascadeType.ALL ,mappedBy = "corperation")
    private BaseInformation info;
    
    @OneToMany(cascade = CascadeType.ALL ,mappedBy = "corperation",fetch = FetchType.LAZY)
    private  Set<GrabageProduceDestInfo> dests;
    
    @OneToMany(cascade = CascadeType.ALL ,mappedBy = "declaration",fetch = FetchType.LAZY)
    private  Set<GrabageFacilities> facis;
    
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getDeclareYear() {
        return declareYear;
    }

    public void setDeclareYear(Integer declareYear) {
        this.declareYear = declareYear;
    }

    public Integer getOpenningYear() {
        return openningYear;
    }

    public void setOpenningYear(Integer openningYear) {
        this.openningYear = openningYear;
    }

    public String getCooperationCode() {
        return cooperationCode;
    }

    public void setCooperationCode(String cooperationCode) {
        this.cooperationCode = cooperationCode;
    }

    public String getCooperation() {
        return cooperation;
    }

    public void setCooperation(String cooperation) {
        this.cooperation = cooperation;
    }

    public String getFaxNumber() {
        return faxNumber;
    }

    public void setFaxNumber(String faxNumber) {
        this.faxNumber = faxNumber;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public Integer getTradeCode() {
        return tradeCode;
    }

    public void setTradeCode(Integer tradeCode) {
        this.tradeCode = tradeCode;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public String getCorporationAddress() {
        return corporationAddress;
    }

    public void setCorporationAddress(String corporationAddress) {
        this.corporationAddress = corporationAddress;
    }

    public String getEnvironmentalPrincipal() {
        return environmentalPrincipal;
    }

    public void setEnvironmentalPrincipal(String environmentalPrincipal) {
        this.environmentalPrincipal = environmentalPrincipal;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public String getCreatedUser() {
        return createdUser;
    }

    public void setCreatedUser(String createdUser) {
        this.createdUser = createdUser;
    }

    public String getAssessor() {
        return assessor;
    }

    public void setAssessor(String assessor) {
        this.assessor = assessor;
    }

    public Integer getNeedStat() {
        return needStat;
    }

    public void setNeedStat(Integer needStat) {
        this.needStat = needStat;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

	public Set<Audit> getAudits() {
		return audits;
	}

	public void setAudits(Set<Audit> audits) {
		this.audits = audits;
	}

	public BaseInformation getInfo() {
		return info;
	}

	public void setInfo(BaseInformation info) {
		this.info = info;
	}

	public Set<GrabageProduceDestInfo> getDests() {
		if(dests == null)
			return new HashSet<GrabageProduceDestInfo>();
		return dests;
	}

	public void setDests(Set<GrabageProduceDestInfo> dests) {
		this.dests = dests;
	}

	public Set<GrabageFacilities> getFacis() {
		if(facis == null)
			return new HashSet<GrabageFacilities>();
		return facis;
	}

	public void setFacis(Set<GrabageFacilities> facis) {
		this.facis = facis;
	}

    public City getCity() {
        return city;
    }

    public void setCity(City city) {
        this.city = city;
    }

}